import java.util.Random;
import java.util.Scanner;
public class test {
    public static void main(String[] args) {
        Random random=new Random();//设置随机数种子
        Scanner scanner=new Scanner(System.in);
        int guess=random.nextInt(100);
        //如果你想要看到系统设置的数据
        System.out.println("系统设置的数据是"+guess);
        while(true){
            System.out.println("请输入你猜的数字");
            int myguess=scanner.nextInt();
            if(myguess>guess){
                System.out.println("你猜大了");

            }
            else if(myguess<guess){
                System.out.println("你猜小了");
            }
            else {
                System.out.println("你猜对了");
                break;
            }
        }
    }
}


